<div class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width:300px;margin-left:-180px;">
 <?= form_open('founder/leave_management/grant_leave')?> 
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Absent Request Form</h3>
  </div>
  <div class="modal-body">
 
  <?php 
foreach($user as $user_detail)
{
?>
  <table width="100%">
  <tr>
    <td width="31%"><strong>Name</strong></td>
    <td colspan="2"><?= $user_detail->username?></td>
    </tr>
  <tr>
    <td><strong>On date</strong></td>
    <td colspan="2"><?= $user_detail->leave_date?></td>
    </tr>
  <tr>
    <td><strong>Reason</strong></td>
    <td colspan="2"><?= $user_detail->reason?></td>
    </tr>
  <tr>
    <td><strong>Applied on</strong></td>
    <td colspan="2"><?= $user_detail->date_applied?></td>
    </tr>
    <tr>
    <td><strong>Current Status</strong></td>
    <td colspan="2"><?= $user_detail->status?></td>
    </tr>
  <tr>
    <td><strong>Edit</strong></td>
    <td width="33%">
    <?php 

if($user_detail->status == "reject")
{
	$pending = ' checked = "checked"';
}
elseif($user_detail->status == "approved") {	
	$approved = ' checked = "checked"';
}
?>
    <label>
    <input class="radio" type="radio" value="reject" name="status"  <?php if(!empty($pending)){echo $pending;} ?> />Reject
</label>
</td>
    <td width="36%">
    <label><input class="radio"	 type="radio" name="status" value="approved" <?php if(!empty($approved)){echo $approved;} ?> /> Approved</label>
    <input type="hidden" value="<?= $user_detail->id?>" name="id" />
    </td>
  </tr>
</table> 

<?php }?>

  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <input type="submit" class="btn btn-primary" value="Approve Leave" />
  </div>
  </form>
</div>



